package com.itheima.article.feign;


import com.itheima.article.pojo.ApAuthor;
import com.itheima.common.vo.ResultVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "leadnews-article",contextId = "apAuthorFeign")
public interface ApAuthorFeign {


    /**
     * 通过用户id和自媒体id获取作者信息
     * @param apUserId
     * @param wmUserId
     * @return
     */
    @GetMapping("/api/apAuthor/{apUserId}/{wmUserId}")
    ResultVo<ApAuthor> getByApUserIdWmUserId(
            @PathVariable(name = "apUserId")Integer apUserId,
            @PathVariable(name = "wmUserId")Integer wmUserId
    );

    /**
     * 创作者账号
     * @param apAuthor
     * @return
     */
    @PostMapping("/api/apAuthor/add")
    ResultVo add(@RequestBody ApAuthor apAuthor);


}
